
#include "canvas.h"

using namespace Blox;

Canvas * Blox::Canvas::m_pDefault = NULL;
Model * Blox::Canvas::m_pModelCube = NULL;

void Blox::Canvas::LoadDefaultModels()
{
	m_pModelCube = new Model();
	m_pModelCube->Load("");
}

void Blox::Canvas::Draw( AABB const & rAABB, u32 const uCol, float fScale /*= 1.0f*/ )
{
	static Vec v[8];
	rAABB.GetCornerExtents(v,0.95f);
	for( u32 i=0; i<8; i++ )
	{
		v[i] += rAABB.vCentre;
	}

	DrawLine( v[0], v[1], uCol, uCol );
	DrawLine( v[2], v[3], uCol, uCol );
	DrawLine( v[0], v[2], uCol, uCol );
	DrawLine( v[1], v[3], uCol, uCol );

	DrawLine( v[4], v[5], uCol, uCol );
	DrawLine( v[6], v[7], uCol, uCol );
	DrawLine( v[4], v[6], uCol, uCol );
	DrawLine( v[5], v[7], uCol, uCol );

	DrawLine( v[0], v[4], uCol, uCol );
	DrawLine( v[1], v[5], uCol, uCol );
	DrawLine( v[2], v[6], uCol, uCol );
	DrawLine( v[3], v[7], uCol, uCol );

}




